//
//  WaterRecordTableViewCell.m
//  IphoneMapSdkDemo
//
//  Created by huck on 2017/5/23.
//  Copyright © 2017年 Baidu. All rights reserved.
//

#import "WaterRecordTableViewCell.h"
#import "HomeManager.h"
#import "AppUtils.h"
#import "WaterDetailViewController.h"
#import "RecordDetailViewController.h"


@interface WaterRecordTableViewCell ()
@property (nonatomic, copy) NSString *recordId;
@property (nonatomic, copy) NSString *waterName;

@end


@implementation WaterRecordTableViewCell

- (void)awakeFromNib
{
    [super awakeFromNib];
    [self initSubview];
}

-(void)initSubview
{
}

- (void)setInfo:(WaterRecodeItemData *)data index:(NSInteger)index;
{
    _recordId = data.recordId;
    _waterName = data.waterName;
    _nameLabel.text = data.waterName;
    _timeLabel.text = data.scoutTime;
    _dutyLabel.text = data.scoutName;
    if(index%2==0){
        _containerView.backgroundColor = [UIColor whiteColor];
    }else{
        _containerView.backgroundColor = [UIColor colorWithString:COLOR_F7F8F9];
    }
}

- (IBAction)cellClick:(UIButton *)sender
{
    RecordDetailViewController *controller = [[RecordDetailViewController alloc] init];
    controller.recordId = _recordId;
    controller.waterName =_waterName;
    [[AppUtils getNavigationController] pushViewController:controller animated:YES];
}
@end
